package demo6;

public class Test {

    public static void main(String[] args) throws CloneNotSupportedException {
        Person person1 = new Person(10,"lisi");
        Person person2 = (Person) person1.clone();

        System.out.println("修改前：" + person1.money.money);
        System.out.println("修改前：" + person2.money.money);
        person2.money.money = 99.99;
        System.out.println("修改后：" + person1.money.money);
        System.out.println("修改后：" + person2.money.money);

    }

    public static void main1(String[] args)
            throws CloneNotSupportedException{
        Person person1 = new Person(10,"lisi");
        Person person2 = (Person) person1.clone();
    }
}
